package shell.config.parser
{
	import flash.utils.Dictionary;
	
	import shell.config.vo.BSkillObj;
	import com.hobbit.analyze.core.IParsers;

	/**
	 * 技能配置表 
	 * @author 晓晔
	 * 
	 */
	public class SkillParser implements IParsers
	{
		private var _skillDic:Dictionary;
		public function SkillParser()
		{
		}
		
		public function parser($data:XML):void
		{
			if(!_skillDic)
				_skillDic = new Dictionary();
			
			var itemList:XMLList = $data.item;
			for(var i:int = 0;i<itemList.length();i++)
			{
				var so:BSkillObj  = new BSkillObj();
				so.attack_type = itemList[i].attack_type;
				so.cate = itemList[i].cate;
				so.id = itemList[i].id;
				so.intro = itemList[i].intro;
				so.is_passive = itemList[i].is_passive;
				so.name = itemList[i].name;
				so.skill_arg = itemList[i].skill_arg;
				so.swf = itemList[i].swf;
				_skillDic[so.id] = so;
			}
		}
		
		public function getItem($key:String):*
		{
			return null;
		}
		
		public function getDic():Dictionary
		{
			return _skillDic;
		}
	}
}